//
//  CMDBHomeUserProfileTableView.swift
//  CMDB
//
//  Created by 曹桂祥 on 2017/5/6.
//  Copyright © 2017年 CMDB. All rights reserved.
//

import UIKit

private let CMDBUserProfileCellID = "CMDBUserProfileCellID"

class CMDBHomeUserProfileTableView: CMDBBaseTableView {

    var controller : UIViewController?
    
    override func setupTableView() {
        super.setupTableView()
        
        self.registerClass(CMDBUserProfileCell.self, forCellReuseIdentifier:CMDBUserProfileCellID)
    }
    
    override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
        
       let cell = dequeCellAndLoadContentFromAdapter(tableViewAdapterArray![indexPath.row] , indexPath: indexPath, tableView: self, controller: nil,cellReuseIdentifier : CMDBUserProfileCellID)
        
        return cell
        
    }
    
    override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
        
        let viewModel = tableViewdataArray![indexPath.row] as! CMDBProfileModel

        return viewModel.cellHeight
    }
}
